home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / utility / 71 / utl / monst.doc < prev    next >
Encoding:
Text File  |  1986-11-21  |  15.6 KB  |  442 lines

  1. MonST.doc - Translation of manual for MonST monitor program
  2. 10/02/86 - Ron Sprunger
  3.  
  4. Corrections 10/05/86 - Ron Sprunger
  5.  
  6.  
  7. *** Introduction to MonST - Version 1.0 - 3/86 ***
  8. Program by:
  9.  
  10. Matthias Meyer
  11. Rosenwinkel 36
  12. 2380 Schleswig
  13. West Germany
  14.  
  15. "Looking under the keys"
  16. -------------------------
  17.  
  18. MonSt is a comfortable and powerful monitor program for the Atari ST.
  19. The program is fully relocatable, and will run anywhere in memory, but
  20. not on EPROM.  It makes little use of GEMDOS, and has only one XBIOS call,
  21. so it will work with all versions of TOS.
  22.  
  23. To use the program, you must have an eighty-character monitor, either
  24. high or medium resolution only.
  25.  
  26. When MonST is started, it displays the block of memory which it has
  27. occupied.  The user should remember or write down these addresses in
  28. order to avoid accidentally overwriting the monitor.
  29.  
  30. Use the program with care!  You are working very close to the machine
  31. itself, which means that careless memory edits can quickly crash the
  32. computer.
  33.  
  34.  
  35. a) Full Screen Editor
  36.  
  37. TOS unfortunately provides only keyboard-in and picture-out routines,
  38. and not (as for instance the old Commodores) a picture-in routine.  In
  39. other words, the screen cannot be read easily to pickup the changes
  40. which might have been made.  For this reason, a 2000 byte buffer is used
  41. to hold the screen text, making changes directly on the screen possible.
  42. This text buffer lies just above the program code, and uses no RAM
  43. outside of the program code area (except for the exception vectors -
  44. see "V").
  45.  
  46. - The cursor can be moved all over the screen with the cursor control
  47.   keys (arrows).
  48.  
  49. - <RETURN> scans the current line, and updates memory accordingly.  At the
  50.   start, periods or blank positions will be skipped over.  (If someone
  51.   can make better sense than I can of the treatment of periods and blanks,
  52.   please let me know. - RS)
  53.  
  54. - <Backspace> erases the character to the left of the cursor, and shifts
  55.   the rest of the line to the left.
  56.  
  57. - <Delete> erases the character under the cursor.
  58.  
  59. - <Insert> opens an empty position.
  60.  
  61. - <Home> moves the cursor to the upper left corner of the screen.
  62.  
  63. - <Undo> moves the cursor to bottom left corner of the screen.
  64.  
  65. - <Shift-Clr> clears the screen.
  66.  
  67. - Other commands:
  68.     <Ctrl-RETURN>  Jumps to the next line WITHOUT updating memory
  69.     <Tab>          Moves cursor ten positions right
  70.     <Ctrl-I>       Inserts a line
  71.     <Ctrl-D>       Removes a line
  72.     <Ctrl-A>       Deletes to end of line
  73.     <Ctrl-C>       Abandons the edit - returns to desktop (!)
  74.     <Help>         Redisplays screen from the text buffer
  75.                    (see "O" command)
  76.  
  77. - The numeric keypad can be used for hex digits, "(" for "A", ")" for
  78.   "B", etc.  You can use "." on the keypad for Backspace.
  79.  
  80.  
  81. b) Monitor Commands
  82.  
  83.    The most important commands are standard, most of the others follow
  84.    the convention of SMON for the C64.  Lower or upper case may be used
  85.    (with exceptions).
  86.  
  87.    Addresses are given and received as 6-digit hex numbers.
  88.  
  89.    If two addresses are used to describe the same object, the second
  90.    address will be invalid.
  91.  
  92.    Parameters in square brackets "[]" are optional and may be omitted.
  93.  
  94. - X
  95.   (Exit)
  96.   Leave MonST, if the "are you sure" question is answered with "y".
  97.   When the program is exited in this manner, the reserved memory
  98.   (about 12 KB) will not be released.  The previously changed exception
  99.   vectors remain pointed to MonST (see "V").  For this reason, MonST
  100.   should be re-entered via a system error, such as violation of
  101.   privileged memory.  (Otherwise, each invocation of the program creates
  102.   a new copy of MonST 12K higher in memory.)  This is easily done in
  103.   ST-BASIC with ?peek(-1).  If no register contents have been changed,
  104.   "G" returns you to BASIC.  Other program errors can also be started
  105.   in this manner, but you should use the disassembler to examine the
  106.   position of the error, since the program counter may not be correct
  107.   after a buss error ("g" points in this case to exception number 4].
  108.  
  109.  
  110. - R
  111.   (Register)
  112.   Gives the contents of the processor register, which can be changed
  113.   with the editor.  The register contents will be given to the processor
  114.   with a GO- or Trace-Failure.
  115.  
  116.  
  117. - G [05 0000]
  118.   (Go)
  119.   Starts a 68000 machine language program at address $050000.  If no
  120.   address is given, the actual value of the program counter (PC) will
  121.   be used.
  122.  
  123.  
  124. - M 05 0000  [05 0100]
  125.   (Memory)
  126.   Gives contents of RAM or ROM as a hex dump with ASCII to the right.
  127.   Stop and proceed slowly with <Space>.  Other keys produce a faster
  128.   display.  <ESC> stops the display.
  129.  
  130.   In RAM, the hex dump can be changed with the editor.  Empty positions
  131.   are ignored.  The listing can be scrolled up or down when editing.
  132.  
  133.  
  134. - K 01 e000  [01 f000]
  135.   (Kontrolle)
  136.   Displays 64 characters of text per line from memory.  Control characters
  137.   (less than ASCII 32) will be displayed as periods.  When editing, small
  138.   and capital letters will be differentiated, periods ignored.  Otherwise
  139.   the same as "M".
  140.  
  141.  
  142. - D fc 0008  [fc 0200]
  143.   (Disassemble)
  144.   Disassemble and list from $FC0008 to $FC0200 with machine code decoded
  145.   to opcodes.  Changes are unfortunately only on the hex words possible,
  146.   since an assembler is not yet included in the program.  This at least
  147.   allows easy modification of some operands.  With the help of a 68000
  148.   opcode table and some patience, small programs can also be entered.
  149.  
  150.   Since the structure of 68000 machine code is very complex, this part
  151.   of MonST is sadly somewhat buggy.  Attention should be payed to the
  152.   following:  It is not entirely inconceivable that a correct processor
  153.   command will be incorrectly decoded (although I have not found any
  154.   errors lately).  If this should happen, please pass the information
  155.   on to me.  In addition, illegal opcodes will not always be recognized
  156.   as such and flagged with "???".  For example, code such as:
  157.  
  158.       MOVE.W   D0,#1234   or   CLR.B   061234(PC)
  159.  
  160.   is nonsensical, or illegal, but might not be flagged as such by the
  161.   program.  For this reason, the disassembler can get out of sync (for
  162.   instance starting to disassemble on an operand instead of on an op-
  163.   code), and display relatively long stretches of  garbage.  Scrolling
  164.   the disassembler (as with "M" and "K") is useless because of this.
  165.  
  166.  
  167. - >O {1,2}
  168.   Switch printer protocol in/out
  169.   0: Output to screen only
  170.   1: Centronics port
  171.   2: RS 232
  172.  
  173.  
  174. - L filename.xyz,  05 0000     or
  175.   L"filename.xyz"  05 0000
  176.   (Load)
  177.   Loads specified data file.  You must always give a load address!
  178.  
  179.  
  180. - S filename.xyz,  05 0000     or
  181.   S"filename.xyz"  05 0000
  182.   (Save)
  183.   Writes the memory area to disk.  If the file name already exist on the
  184.   disk, you will be asked "are you sure?".
  185.  
  186.  
  187. - @ [fil??ame.*]
  188.   Shows a directory of the disk.  If "@" is followed by a space, the
  189.   characters which follows will be interpreted as a search mask.  "?"
  190.   wildcards a character, "*" wildcards remainder of filename or extension.
  191.   If the command is given without a mask, "*.*" will be used (all files
  192.   will be displayed).  The display includes filename, size in bytes,
  193.   and filetype as follows:
  194.  
  195.                             00 - Normal File
  196.                             01 - Write-Protected
  197.                             10 - Subdirectory, not file
  198.  
  199.   At the end of the display, the free allocation units of the diskette
  200.   will be shown (each 1024 bytes long).
  201.  
  202.  
  203. - @\directory\
  204.   Specifies sub-directory or path.  All further disk I/O will use this
  205.   path (Loads, Writes, Directories).  Return to the root directory with
  206.   "@\".
  207.  
  208.  
  209. - @B
  210.   Specifies disk B: as the working disk (A .. E).
  211.  
  212.   The most important errors produced by disk I/O:
  213.  
  214.       -1  General error
  215.       -6  Track not found
  216.       -8  Sector not found
  217.       -13 Disk is write-protected
  218.       -33 File not found
  219.       -34 Path not found
  220.  
  221.  
  222. - F 01 0000 05 0000  41 42 43
  223.   F 01 0000 05 0000  "Digital Research"
  224.   F 01 0000 05 0000  44"igital "*"ese"61"rch"
  225.   (Find)
  226.   Searches byte-wise in specified memory.  Hex digits and text can be
  227.   intermixed.  An asterisk outside of quoted text specifies a wildcard
  228.   character.  The addresses of matches will be given - use <ESC> to
  229.   break off the search.
  230.  
  231.  
  232. - F "-****(a*)" 03 0000 [03 1000]
  233.   Searches for string in the disassembler listing from $030000 [to
  234.   $031000] - "*" is a wildcard character.  This example searches for
  235.   all commands which use the "address register indirect with (negative)
  236.   16 bit offset" reference mode.  <ESC> stops the search.
  237.  
  238.  
  239. - O 07 8000 08 0000  01 02 03     (512 KB RAM)
  240.   O 0f 8000 10 0000  aa 55        (1024 KB RAM)
  241.   (Occupy)
  242.   Fill memory with specified long word value.  If no value is given,
  243.   the default is 00.  Check out the above commands for a 512 KB and a
  244.   1024 KB machine.  The screen will fill with a fine point pattern -
  245.   pressing the <Help> key will restore the display.
  246.  
  247.  
  248. - W 05 0000  06 0000  07 0000
  249.   (Write)
  250.   Moves memory bank $050000 - $05ffff to $070000.
  251.  
  252.  
  253. - = 05 0000  06 0000
  254.   The memory bank starting at $050000 is compared with that starting
  255.   at $060000.  The position of the first non-match will be shown.
  256.  
  257.  
  258. - #491520
  259.   Convert decimal number to Hex.  Max 2^32-1
  260.  
  261.  
  262. - $00078000
  263.   Convert 8-digit hex number to Decimal.
  264.  
  265.  
  266. - %10101011
  267.   Convert 8-digit binary number to decimal.
  268.  
  269.  
  270. - ?z xxxxxxxx yyyyyyyy
  271.   Simple calculator, where z = :
  272.       + : 32 bit addition (2 8-digit hex numbers follow)
  273.       - : 32 bit subtraction
  274.       * : 16 bit multiplication (2 4-digit hex numbers follow)
  275.       / : Divide 32 bit number by 16 bit number
  276.       & : 32 bit logical AND
  277.         : OR
  278.       ! : EXCLUSIVE OR
  279.  
  280.  
  281. - V
  282.   (Vectors)
  283.   Displays the vector table from low RAM ($0000 to $3fff).  Addresses
  284.   marked with an asterisk point to the BREAK-entry into MonST.  The far
  285.   left-hand byte gives the exception number.  Stop display with <ESC>.
  286.  
  287.   Upon startup of MonST, the exceptions number 2,3,4,5,6,7,8,9, and 32
  288.   (buss, address error, illegal opcode, divide-by-zero, CHK-error,
  289.   TRAPV-error, privilege violation, trace-mode, Trap #0) will be diverted
  290.   to the register pointers.  Should one of the "errors" occur, an attention
  291.   character and a blinking cursor will appear in the lower left corner of
  292.   the screen.  The purpose of this is to avoid too-quickly destroying the
  293.   contents of the screen.
  294.  
  295.   Pressing <ESC> releases the register display.  A keypress produces an
  296.   announcement of the exception number, and the processor register will
  297.   be pointed to the location of the break.  If it is a buss or address
  298.   error, the information placed by the CPU on the stack will not be
  299.   lost.  It is this status word, holding the flags in the lower 8 bits,
  300.   which describes the error more exactly, including the target address
  301.   which produced the error and the last opcode acted on.  A buss error
  302.   can easily arise, if you try to access memory not implemented in
  303.   hardware, or to write to ROM.  You must be carefull not to set the
  304.   stack pointer too low, thereby destroying something.  Be sure to
  305.   restore it to the appropriate value.
  306.  
  307.  
  308. - TS 05 0000  05 0010
  309.   (Trace Stop)
  310.   The program will be started at $050000 and will break when $050010
  311.   is reached.  This function uses the Trap #0 opcode, which is installed
  312.   at the stop address before beginning execution.  The machine instruct-
  313.   ion from that location is saved and restored after execution.
  314.  
  315.  
  316. - TW [05 0000]
  317.   (Trace Walk)
  318.   Opcodes starting at $050000 (for example) are executed one at a time,
  319.   with the help of the trace-bits in the status register.  The screen is
  320.   split into two windows: in the upper, the applicable processor
  321.   is shown, and in the lower is the running program.  The next opcode
  322.   is displayed in the second-to-last line (pointed to by the current
  323.   program counter).  On the bottom line is a small menu, to remind you
  324.   of additional possible functions:
  325.  
  326.       <Space> Executes the next instruction
  327.       <ESC>   Aborts
  328.       <C>     Does the same as <Help> usually does (separates characters
  329.               or graphics written to the graphics screen from other
  330.               programs).
  331.       <S>     Executes a sub-program in real time from beginning to
  332.               end (to the RTS opcode).
  333.       <E>     Does the same for an exception handler (to the RTE opcode).
  334.  
  335.   For the last two, the stack pointer must be the same at the end of
  336.   the sub-program as it was at the beginning.  An example: By stepwise
  337.   execution, you come to an error Trap #1, which calls GEMDOS.  In order
  338.   to run this program all at once, you press <Space> and see in the
  339.   next-to-last line "BTST #5,(a7).  This is the beginning of GEMDOS.
  340.   Now you can press <S>, and GEMDOS will do its work undisturbed.  The
  341.   next command after the TRAP #1 will be shown.  <E> can only used with
  342.   the supervisor bit set.  If no return address is on the stack, the
  343.   program may run off into never-never land.
  344.  
  345.   This all sounds very complicated, but with practice it goes smoothly.
  346.  
  347.   "TW" works in ROM as well as RAM.  Single-step execution lends itself
  348.   especially to exploration of complicated calculations made by the
  349.   CPU.
  350.  
  351.   With the trace-bit set, a test program will not crash due to conflict
  352.   in the status word, so that a command such as "MOVE #2300,SR" can
  353.   be traced at your leisure.
  354.  
  355.  
  356. - TB 05 0010  000a
  357.   (Trace Break) - parameters are address and word
  358.   A break point will be set at $050010 for fast step mode.  Upon
  359.   reaching the address for the 10th time, the program will be interrupted,
  360.   and single-step mode will begin.
  361.  
  362.  
  363. - TQ [05 0000]
  364.   (Trace Quick)
  365.   Fast step mode is only for use in RAM, and is used in conjunction
  366.   with TB (see above).  These functions lend themselves to convenient
  367.   exploration of the operation of loops.
  368.  
  369.  
  370. - TA 05 0000  0001 0000
  371.   (Trace Amount) - takes address, longword parameters
  372.   Starting at $050000, 2^16 machine instructions will be executed,
  373.   though with somewhat limited speed.  All sub-programs will be
  374.   counted, as well as group two exceptions (TRAP's, CHK, Division
  375.   by zero).  Up to 2^32-1 instructions can be counted (4.3 billion).
  376.   In addition, the program may encounter instructions which set the
  377.   trace bit back!  May be used in ROM.
  378.  
  379.  
  380.  
  381.  
  382. c) The Disk Editor
  383.  
  384.    The disk editor is invoked from MonST with "Z".  It needs a 512
  385.    byte buffer, whose absolute address may be specified ($050000 is
  386.    recommended, or somewhere in the middle of free RAM).
  387.  
  388.    All disk I/O is done on drive A: (!)
  389.  
  390.  
  391. - X
  392.   (Exit)
  393.   Exits the disk editor
  394.  
  395.  
  396. - P
  397.   (Page)
  398.   Toggles the disk side, 0 or 1, with the result displayed.
  399.   Use ONLY on double sided drives!
  400.  
  401.  
  402. - B
  403.   Change the buffer address (restart the disk editor)
  404.  
  405.  
  406. - M
  407.   Show the contents of the buffer.  The contents may be edited.
  408.  
  409.  
  410. - R 01 03
  411.   Read sector 03, track 01 (hex)
  412.   Only "R" and "W" specify the actual track and sector numbers.
  413.  
  414.  
  415. - W 01 03
  416.   Write the buffer contents to sector 03, track 01 (hex)
  417.  
  418.  
  419. - +
  420.   Read the next sector
  421.  
  422.  
  423. - -
  424.   Read the previous sector
  425.  
  426.  
  427.  
  428.   In the disk monitor, scrolling text up/down is also possible.  The
  429.   sector buffer may also be accessed from the machine monitor.
  430.  
  431.   ----------------------  The End  (Das Ende)  ------------------------
  432.  
  433.   Note from translator:
  434.  
  435.       The above is a fairly literal translation of the manual for
  436.       MonST as provided on BIX by Jim Omoura.  The translator believes
  437.       that the translation is accurate, but does not have the working
  438.       program to check points of operation.  I take NO responsibility
  439.       for the accuracy of the above document.
  440.  
  441.       Ron Sprunger   (BIX "sprung")
  442.